


        function checkHover(ind,judge){
            if(judge){
                $('.judge .contn .round .check .ring .item:eq(' + ind + ')').addClass('hover')
                $('.judge .contn .round .check .txt .around:eq(' + ind + ')').addClass('hover');
            }else{
                $('.judge .contn .round .check .ring .item:eq(' + ind + ')').removeClass('hover')
                $('.judge .contn .round .check .txt .around:eq(' + ind + ')').removeClass('hover');
            }
        }

        function checkClick(ind){
            var deg = -150;
            $('main .judge .contn .round .line .solid')[0].style.transform = "rotate(" + (deg + ind * 20) + 'deg)';
            $('.judge .contn .round .check .active').removeClass('active');
            $('.judge .contn .round .check .ring .item:eq(' + ind + ')').addClass('active');
            $('.judge .contn .round .check .txt .around:eq(' + ind + ')').addClass('active');
            for(var n = 0;n < $('.judge .contn .round .check .ring .item').length;n++){
                if(n <= ind){
                    $('.judge .contn .round .check .ring .item:eq(' + n + ')').addClass('cross');
                    $('.judge .contn .round .check .txt .around:eq(' + n + ')').addClass('cross');
                }else{
                    $('.judge .contn .round .check .ring .item:eq(' + n + ')').removeClass('cross');
                    $('.judge .contn .round .check .txt .around:eq(' + n + ')').removeClass('cross');
                }
            }

            $('main .judge .txtBox .active').removeClass('active');
            $('main .judge .txtBox p:eq(' + ind +')').addClass('active');
            txtBoxUpdateH();
        }
        function txtBoxUpdateH(){
            $('main .judge .txtBox').height($('main .judge .txtBox .active')[0].offsetHeight);
        }
        var middle = parseInt($('main .teachers .teacherList .item').length / 2);
        var itemScaleXbase = 0.45;
        var itemScaleXCalBase = 0.03;
        var boxScaleYbase = 0.9;
        var translateXbase = 28;
        var translateXCalBase = 14;
        function prepareSonEles(ele){
        
            var scaleX = ele[0].scaleX;
            var scaleY = ele[0].scaleY;
            var translateX = ele[0].translateX;
            var rotateY = ele[0].rotateY;
            ele[0].style.transform = 'translateX(' + translateX + '%) scale(' + scaleX + ',' + scaleY + ') rotateY(' + rotateY + 'deg)';
            var boxScaleY = boxScaleYbase;
            console.log(scaleX);
            console.log(ele.find('.box')[0]);
            ele.find('.box')[0].style.transform = 'scale(' + String((1 / scaleX).toFixed(5)) + ',' + boxScaleY + ')';
            ele.find('.box img')[0].style.transform = 'scale(1,' + String((1 / boxScaleY).toFixed(5)) + ')';
        }


        $(document).ready(function(){
            txtBoxUpdateH();
            for(var i = 0;i < $('.judge .contn .round .check .ring .item').length;i++){
                $('.judge .contn .round .check .ring .item')[i].ind = i;
                $('.judge .contn .round .check .txt .around')[i].ind = i;
            }
            $('.judge .contn .round .check .aim').mouseenter(function(){
                var index = $(this)[0].ind;
                var inOrNot = true;
                checkHover(index,inOrNot)
            })
            $('.judge .contn .round .check .aim').mouseleave(function(){
                var index = $(this)[0].ind;
                var inOrNot = false;
                checkHover(index,inOrNot)
            })
           
            $('.judge .contn .round .check .aim').click(function(){
                var index = $(this)[0].ind;
                checkClick(index);
            })
            
            $('main .teachers .teacherList .item:eq(' + middle + ')')[0].scaleX = itemScaleXbase;
            $('main .teachers .teacherList .item:eq(' + middle + ')')[0].translateX = 0;
            $('main .teachers .teacherList .item:eq(' + middle + ')')[0].scaleY = 1;
            prepareSonEles($('main .teachers .teacherList .item:eq(' + middle + ')'));
            for(var lft = 1;lft <= middle;lft++){
                $('main .teachers .teacherList .item:eq(' + (middle - lft) + ')')[0].translateX = -translateXbase - (lft - 1) * translateXCalBase;
                $('main .teachers .teacherList .item:eq(' + (middle - lft) + ')')[0].scaleX = itemScaleXbase - lft * itemScaleXCalBase;
                $('main .teachers .teacherList .item:eq(' + (middle - lft) + ')')[0].scaleY = 1 / (middle + 1) * (middle - lft + 1);
                $('main .teachers .teacherList .item:eq(' + (middle - lft) + ')')[0].rotateY = -15;
                prepareSonEles($('main .teachers .teacherList .item:eq(' + (middle - lft) + ')'));
            }
            for(var rht = middle + 1;rht < $('main .teachers .teacherList .item').length;rht++){
                $('main .teachers .teacherList .item:eq(' + rht + ')')[0].translateX = translateXbase + (rht - middle) * translateXCalBase;
                $('main .teachers .teacherList .item:eq(' + rht + ')')[0].scaleX = itemScaleXbase - (rht - middle) * itemScaleXCalBase;
                $('main .teachers .teacherList .item:eq(' + rht + ')')[0].scaleY = 1 / (middle + 1) * ($('main .teachers .teacherList .item').length - rht);
                $('main .teachers .teacherList .item:eq(' + rht + ')')[0].rotateY = 15;
                prepareSonEles($('main .teachers .teacherList .item:eq(' + rht + ')'));
            }
        })